<!DOCTYPE html>
<html>
	<head lang="en">
		<meta charset="utf-8" />
		<title>提交订单</title>
		<link rel="stylesheet" type="text/css" href="css2/public.css"/>
		<link rel="stylesheet" type="text/css" href="css2/proList.css" />
		<link rel="stylesheet" type="text/css" href="css2/mygxin.css" />
	</head>
	<style type="text/css">
		.content{
			width: 700px;height: 400px;
			border: 3px solid #eee8ea;
		}
		.form{
			margin-top:15px;
			padding-top: 30px;
			width: 100%;
			height: 480px;
			border-radius: 30px;
			position: relative;
			background-size: 100% 100%;}
		.form form{
			width: 80%;
			font-family: "楷体";
			margin-left: 180px;
			font-size: 30px;
		}
		.form input{
			margin: 6px 0px;
			font-size: 24px;
			width: 50%;
			height: 50px;
		}
.tj button{cursor: pointer;
			margin-left: 100px;
text-align: center;
			color: white;
			position: absolute;
			margin-top: 15px;
			width: 20%;
			height: 40px;
			line-height: 40px;
			border-radius: 13px;
			background-color: #c10000;
		}
		.tj a{
			cursor: pointer;
			margin-left: 160px;
text-align: center;
			color: white;
			position: absolute;
			margin-top: 15px;
			width: 20%;
			height: 40px;
			line-height: 40px;
			border-radius: 13px;
			background-color: #c10000;
		}
/*		.zf{
cursor: pointer;
position: absolute;
			margin-left: 160px;
text-align: center;
			color: white;
margin-top: -18px;
			width: 12%;
			height: 40px;
			line-height: 40px;
			border-radius: 13px;
			background-color: #c10000;
		}*/
	</style>
	<body>
		<?php require 'top.php';?>





		
		<div class="order cart mt">
			<!-----------------site------------------->
			<div class="site">
				<p class="wrapper clearfix">
					<span class="fl">订单确认</span>
					<img class="top" src="img/temp/cartTop02.png">
				</p>
			</div>
			<!-----------------orderCon------------------->
			<div class="orderCon wrapper clearfix">
				<div class="orderL fl">
					<!--------h3---------------->
					<h3>收件信息</h3>
					<!--------addres---------------->
					<div class="addres clearfix">
<!-- ------------------------------------ -->
<?php

$con = "SELECT * FROM carts WHERE uemail='".$_SESSION['login']."'";
$que = mysqli_query($config,$con);


$userinfo = mysqli_fetch_array($que,MYSQLI_ASSOC);
       if(isset($_SESSION['login'])){ 

// var_dump($userinfo['goodsid']);
?>
   <!-- 提前结束php语句 -->


<div class="content">
							

	<div class="form">
		<form method="post" name="form_reg" action="order_tj.php">
		<!-- action="checkreg.php" -->

		<label for="tj_name">收件姓名:</label>
		<input id="tj_name" type="text" required="required" placeholder="输入姓名" name="tj_name"><br/>
		<label for="tj_tel">收件电话:</label>
		<input id="tj_tel" type="text" required="required" placeholder="输入十一位电话号码" name="tj_tel"><br/>
		<label for="tj_address">收件地址:</label>
		<input id="tj_address" type="text" required="required" placeholder="输入收件地址" name="tj_address"><br/>
		<label for="tj_yzbm">邮政编码:</label>
		<input id="tj_yzbm" type="text" required="required" placeholder="输入邮政编码" name="tj_yzbm"><br/>

		
		<div class="tj">
			<button type="submit" onclick="return check();" style="background-color:#c10000;">信息保存</button>
				<!-- <a href="order_goods_kucun.php?id=<?php echo $userinfo['buyerid']?>"style="color: white;">提交订单</a> -->
			
			<br/>
		</div>
		<?php 
	}
		?> 

	</form>
	</div>




</div>








					</div>
					<h3>支付方式</h3>
					<!--------way---------------->
					<div class="way clearfix">
						<!-- <img  src="img/temp/way01.jpg"> 
						<img src="img/temp/way02.jpg"> 
						<img src="img/temp/way03.jpg">  -->
						<img class="on"src="img/temp/way04.jpg"> 
					</div>
					<h3>选择快递</h3>
					<!--------dis---------------->
					<div class="dis clearfix">
						<span class="on">同校配送</span>
						<!-- <span >顺风快递</span>
						<span>圆通快递</span>
						<span>中通快递</span> -->
					</div>
				</div>

				<?php 
				error_reporting(5);
error_reporting(E_ALL & ~E_NOTICE);
error_reporting(0);
header('content-type:text/html;charset=utf-8');
//身份验证
session_start();
if (!isset($_SESSION['login'])) {
	header('Refresh:2;url=login/index.php');
	echo "你还没有登陆！";
	die();
}

$field=$_GET['buyerid'];

	       if($field!=""){
	       	$sql="SELECT * FROM carts WHERE `buyerid`='$field' ";
	       	$result = mysqli_query($config,$sql) or die ('SQL语句有误：'.mysqli_error());
	       }



				?>




				<div class="orderR fr">
					<div class="msg">
						<h3>订单内容
							<a href="http://localhost/school/cart.php?buyerid=3" class="fr">返回购物车</a></h3>


						<!--------ul---------------->

						<?php 


$sum=0;
$yf=3;
 while ($ro=mysqli_fetch_array($result)){
 	$sum=$sum+$ro['cost'];
// var_dump($sql);

?>


						<ul class="clearfix">

							<li class="fl" style="width: 140px;height: 120px; ">
								<img src="images/goods/<?php echo $ro['bigtypeid'];?>/<?php echo $ro['smalltypeid'];?>/<?php echo $ro['picture'];?>" style="width: 100%;height: 100%;">
							</li>
							<li class="fl">
								<p><?php echo $ro['goodsname'];?></p>
								<p>数量：1</p>
							</li>
							<li class="fr">￥<?php echo $ro['cost'];?></li>
						</ul>


<?php      
  }
// }
?>


					</div>
					<!--------tips---------------->
					<div class="tips">
						<p><span class="fl">商品金额：</span><span class="fr" style="color: #c10000;">￥<?php echo $sum;?></span></p>
						<p><span class="fl">优惠金额：</span><span class="fr">￥0.00</span></p>
						<p><span class="fl">运费：</span><span class="fr">￥3.00</span></p>
					</div>
					<!--------tips count---------------->
					<div class="count tips">
						<p><span class="fl">合计：</span><span class="fr">￥<?php echo $sum+$yf;?></span></p>
					</div>
					<!--<input type="button" name="" value="去支付"> -->
					<!-- ----------------------------------------------------------- -->
					<!-- <a  class="pay" onclick="return check();" href="order_ok.php?buyerid=<?php echo $user_email;?>" style="font-size:20px;">提交订单</a> -->
					 
		


				</div>
			</div>
		</div>
		<!--编辑弹框-->
		<!--遮罩-->
		<!-- <div class="mask"></div>
		<div class="adddz editAddre">
			<form action="#" method="get">
				<input type="text" placeholder="姓名" class="on" />
				<input type="text" placeholder="手机号" />
				<div class="city">
					<select name="">
						<option value="省份/自治区">省份/自治区</option>
					</select>
					<select>
						<option value="城市/地区">城市/地区</option>
					</select>
					<select>
						<option value="区/县">区/县</option>
					</select>
					<select>
						<option value="配送区域">配送区域</option>
					</select>
				</div>
				<textarea name="" rows="" cols="" placeholder="详细地址"></textarea>
				<input type="text" placeholder="邮政编码" />
				<div class="bc">
					<input type="button" value="保存" />
					<input type="button" value="取消" />
				</div>
			</form>
		</div> -->
		







		<script src="js2/jquery-1.12.4.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js2/public.js" type="text/javascript" charset="utf-8"></script>
		<script src="js2/pro.js" type="text/javascript" charset="utf-8"></script>
		<script src="js2/user.js" type="text/javascript" charset="utf-8"></script>



		<script type="text/javascript">
	function check(){

		// 检查手机
		if(document.form_reg.tj_tel.value=="")
		 {
		 	alert("请输入手机号");
		 	document.form_reg.tj_tel.focus();
		 	return false;
		 }
		 var tj_tel = document.form_reg.tj_tel.value;
		 var c=/^1[34578]\d{9}$/;
		 if (!(c.test(tj_tel))) {
		 	alert("手机号码格式错误！");
		 	document.getElementById("tel").value="";
		 	document.form_reg.tj_tel.focus();
		 	return false;
		 }

	}
</script>
	</body>

</html>
